import request from '@/utils/request'

/**
 * 登录
 * @param loginModel
 * @returns {*}
 */
const login = (loginModel) => {
  return request({
    url: '/api/sa-token/login',
    method: 'POST',
    data: loginModel
  })
}

/**
 * 获取当前用户信息
 * @returns {*}
 */
export function getCurrentUserInfo() {
  return request({
    url: '/api/sa-token/getCurrentUserInfo',
    method: 'GET'
  })
}

/**
 * 注销登录
 * @returns {*}
 */
export function logout() {
  return request({
    url: '/api/sa-token/logout',
    method: 'GET'
  })
}

export default {
  login,
  getCurrentUserInfo,
  logout
}
